package com.pig4cloud.pigx.strategy.executor.contract.stop_order;

import com.pig4cloud.pigx.strategy.bo.okx.PlaceStopOrderBO;
import com.pig4cloud.pigx.strategy.dto.StrategyStopOrderContractCancelBatchDTO;
import com.pig4cloud.pigx.strategy.dto.StrategySyncStopOrderMsgDTO;
import org.springframework.beans.factory.InitializingBean;

/**
 * 策略-合约 止盈止损处理器
 *
 * @since 2022/11/27 19:51
 */
public interface StrategyStopOrderContractHandler extends InitializingBean {

    /**
     * 根据平台id判断是否支持
     *
     * @param platformId 平台id
     * @return {@link boolean}
     * @since 2022/11/29 17:27
     */
    boolean support(Long platformId);

    /**
     * 创建止盈止损委托
     *
     * @param bo bo
     * @since 2023/2/8 13:46
     */
    void place(PlaceStopOrderBO bo);

    /**
     * 同步止盈止损
     *
     * @param dto dto
     * @since 2023/2/8 14:00
     */
    void sync(StrategySyncStopOrderMsgDTO dto);

    /**
     * 批量撤销止盈止损
     *
     * @param dto dto
     * @since 2023/2/10 15:10
     */
    void cancelBatch(StrategyStopOrderContractCancelBatchDTO dto);
}
